//
//  BLDetailButton.swift
//  BLLiveTelecast
//
//  Created by BigL055 on 16/5/28.
//  Copyright © 2016年 bigL.liveTelecast.com. All rights reserved.
//

import UIKit


class BLIconButton: UIButton {
    
    lazy var iconImageView : UIImageView? = UIImageView()
    lazy var iconNameLabel : UILabel? = UILabel()
    
    /// 取消高亮
    override var highlighted: Bool{
        willSet{
            
        }
    }
    
    func configureUI() {
        iconNameLabel?.adjustsFontSizeToFitWidth = true
        iconNameLabel?.textColor = UIColor.blackColor()
        iconNameLabel?.font = bl_Font_14
        iconNameLabel?.textAlignment = .Center
        
        iconImageView?.contentMode = .ScaleAspectFit
        iconImageView?.layer.cornerRadius = (iconImageView?.bounds.width)! * 0.5
        iconImageView?.clipsToBounds = true
        
        
        self.addSubview(iconImageView!)
        self.addSubview(iconNameLabel!)
        
        
        iconNameLabel?.snp_makeConstraints(closure: { (make) in
            make.bottom.left.right.equalToSuperview()
            make.height.equalTo(15)
        })
        
        iconImageView?.snp_makeConstraints(closure: { (make) in
            make.bottom.right.equalToSuperview().offset(-20)
            make.top.left.equalToSuperview().offset(20)
        })
        
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        configureUI()

    }
    
    
}
